package com.wn.pettyloan.service.impl;

import com.wn.pettyloan.dto.ProductDto;
import com.wn.pettyloan.entity.Product;
import com.wn.pettyloan.mapper.ProductMapper;
import com.wn.pettyloan.service.ProductService;
import com.wn.pettyloan.vo.ProductVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：Morsera
 * @date ：Created in 2022/12/7 18:29
 * @description：
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductMapper productMapper;

    @Override
    public int add(Product product) {
        return productMapper.insertSelective(product);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return productMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insertSelective(Product record) {
        return productMapper.insertSelective(record);
    }

    @Override
    public Product selectByPrimaryKey(Long id) {
        return productMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Product record) {
        return productMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<Product> selectAll() {
        return productMapper.selectAll();
    }

    @Override
    public List<Product> selectByLike(ProductDto productDto) {
        return productMapper.selectByLike(productDto);
    }

    @Override
    public int audit(Product record) {
        return productMapper.audit(record);
    }

    @Override
    public Product selectByName(String name) {
        return productMapper.selectByName(name);
    }

    @Override
    public Product ProductFound(String name) {
        return productMapper.ProductFound(name);
    }

    @Override
    public List<ProductVo> exportExcel(ProductDto productDto) {
        return productMapper.exportExcel(productDto);
    }


}
